<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=utf-8" />
<title>Class: TableSetter::Command</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (C)</a> &raquo; 
    <span class='title'><span class='object_link'><a href="../TableSetter.html" title="TableSetter (module)">TableSetter</a></span></span>
     &raquo; 
    <span class="title">Command</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: TableSetter::Command
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">TableSetter::Command</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">lib/table_setter/command.rb</dd>
  
</dl>
<div class="clear"></div>


  <h2>Constant Summary</h2>
  
    <dl class="constants">
      
        <dt id="BANNER-constant" class="">BANNER =
          
        </dt>
        <dd><pre class="code"><span class='string val'>&quot;table-setter is a Sinatra application for rendering and processing CSVs from google docs into HTML.\n\nUsage:\ntable-setter COMMAND path/to/table-setter/assets OPTIONS\n\ncommands:\nstart    run the development server, for deployment use config.ru\ninstall  copy the table-setter assets into the the directory\nbuild    statically build tables in the ./out/ directory\n\noptions:\n&quot;</span>
</pre></dd>
      
    </dl>
  



  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#build_out-instance_method" title="#build_out (instance method)">- (Object) <strong>build_out</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Command) <strong>initialize</strong> </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
A new instance of Command.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#install_assets-instance_method" title="#install_assets (instance method)">- (Object) <strong>install_assets</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#start_server-instance_method" title="#start_server (instance method)">- (Object) <strong>start_server</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  

<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="TableSetter::Command (class)">Command</a></span></tt>) <strong>initialize</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
A new instance of Command
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


25
26
27
28
29
30
31
32
33
34
35
36
37
38</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/command.rb', line 25</span>

<span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span>
  <span class='@prefix ivar id'>@prefix</span> <span class='assign token'>=</span> <span class='string val'>&quot;&quot;</span>
  <span class='parse_options identifier id'>parse_options</span>
  <span class='@prefix ivar id'>@prefix</span> <span class='assign token'>=</span> <span class='dstring node'>&quot;/#{@prefix}/&quot;</span><span class='dot token'>.</span><span class='gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='regexp val'>/^\/\//</span><span class='comma token'>,</span> <span class='string val'>&quot;/&quot;</span><span class='rparen token'>)</span>
  <span class='command identifier id'>command</span> <span class='assign token'>=</span> <span class='ARGV constant id'>ARGV</span><span class='dot token'>.</span><span class='shift identifier id'>shift</span>
  <span class='@directory ivar id'>@directory</span> <span class='assign token'>=</span> <span class='ARGV constant id'>ARGV</span><span class='dot token'>.</span><span class='shift identifier id'>shift</span> <span class='orop op'>||</span> <span class='string val'>'.'</span>
  <span class='TableSetter constant id'>TableSetter</span><span class='dot token'>.</span><span class='configure identifier id'>configure</span> <span class='@directory ivar id'>@directory</span>
  <span class='case case kw'>case</span> <span class='command identifier id'>command</span>
  <span class='when when kw'>when</span> <span class='string val'>'start'</span> <span class='then then kw'>then</span> <span class='start_server identifier id'>start_server</span>
  <span class='when when kw'>when</span> <span class='string val'>'install'</span> <span class='then then kw'>then</span> <span class='install_assets identifier id'>install_assets</span>
  <span class='when when kw'>when</span> <span class='string val'>'build'</span> <span class='then then kw'>then</span> <span class='build_out identifier id'>build_out</span>
  <span class='else else kw'>else</span> <span class='puts identifier id'>puts</span> <span class='BANNER constant id'>BANNER</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
  
</div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="build_out-instance_method">
  
    - (<tt>Object</tt>) <strong>build_out</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


53
54
55
56
57
58
59
60
61</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/command.rb', line 53</span>

<span class='def def kw'>def</span> <span class='build_out identifier id'>build_out</span>
  <span class='@out_dir ivar id'>@out_dir</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='TableSetter constant id'>TableSetter</span><span class='dot token'>.</span><span class='config_path identifier id'>config_path</span><span class='comma token'>,</span> <span class='string val'>'out'</span><span class='comma token'>,</span> <span class='@prefix ivar id'>@prefix</span><span class='rparen token'>)</span>
  <span class='puts identifier id'>puts</span> <span class='string val'>&quot;\nBuilding your TableSetter files...\n\n&quot;</span>
  <span class='app identifier id'>app</span> <span class='assign token'>=</span> <span class='build_rack identifier id'>build_rack</span>
  <span class='@request ivar id'>@request</span> <span class='assign token'>=</span> <span class='Rack constant id'>Rack</span><span class='colon2 op'>::</span><span class='MockRequest constant id'>MockRequest</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='app identifier id'>app</span><span class='rparen token'>)</span>
  <span class='build_index identifier id'>build_index</span>
  <span class='build_assets identifier id'>build_assets</span>
  <span class='build_tables identifier id'>build_tables</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="install_assets-instance_method">
  
    - (<tt>Object</tt>) <strong>install_assets</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


45
46
47
48
49
50
51</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/command.rb', line 45</span>

<span class='def def kw'>def</span> <span class='install_assets identifier id'>install_assets</span>
  <span class='FileUtils constant id'>FileUtils</span><span class='dot token'>.</span><span class='mkdir_p identifier id'>mkdir_p</span> <span class='@directory ivar id'>@directory</span> <span class='unless unless_mod kw'>unless</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='exists? fid id'>exists?</span> <span class='@directory ivar id'>@directory</span>
  <span class='puts identifier id'>puts</span> <span class='string val'>&quot;\nInstalling TableSetter files...\n\n&quot;</span>
  <span class='base_files identifier id'>base_files</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='path identifier id'>path</span><span class='bitor op'>|</span>
    <span class='copy_file identifier id'>copy_file</span> <span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='TableSetter constant id'>TableSetter</span><span class='dot token'>.</span><span class='config_path identifier id'>config_path</span><span class='comma token'>,</span> <span class='path identifier id'>path</span><span class='dot token'>.</span><span class='gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='ROOT constant id'>ROOT</span> <span class='plus op'>+</span> <span class='string val'>&quot;/template/&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;/&quot;</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="start_server-instance_method">
  
    - (<tt>Object</tt>) <strong>start_server</strong> 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


40
41
42
43</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/table_setter/command.rb', line 40</span>

<span class='def def kw'>def</span> <span class='start_server identifier id'>start_server</span>
  <span class='app identifier id'>app</span> <span class='assign token'>=</span> <span class='build_rack identifier id'>build_rack</span>
  <span class='Rack constant id'>Rack</span><span class='colon2 op'>::</span><span class='Handler constant id'>Handler</span><span class='colon2 op'>::</span><span class='Thin constant id'>Thin</span><span class='dot token'>.</span><span class='run identifier id'>run</span> <span class='app identifier id'>app</span><span class='comma token'>,</span> <span class='symbol val'>:Port</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;3000&quot;</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Thu Apr 14 16:57:06 2011 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.6.1 (ruby-1.8.7).
</div>

  </body>
</html>